package org.shoukaiseki.tencent.live.service;

import com.tencentcloudapi.live.v20180801.models.StreamOnlineInfo;
import org.springframework.validation.annotation.Validated;

import javax.validation.Valid;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

@Validated
public interface TencentLiveManagerService {

    public StreamOnlineInfo[] describeLiveStreamOnlineList(String streamName, @NotNull Number pageNum, @NotNull  Number pageSize);

    /**
     *返回直播中、无推流或者禁播等状态
     * @param streamName
     * @return DescribeLiveStreamStateResponse
     */
    public Integer describeLiveStreamState(@NotEmpty String streamName);

    /**
     * 禁用直播推流
     * @param forbidMinute          禁用分钟数
     * @param  streamName
     * @return
     */
    public boolean forbidLiveStream(Number forbidMinute,@NotEmpty String streamName);

    /**
     * 恢复直播推流
     * @param streamName
     * @return
     */
    public boolean resumeLiveStream(@NotEmpty String streamName);


    /**
     * 生成推流地址
     * @param effectivetime            url有效时间,默认5分钟
     * @param streamName            流名称
     * @return
     */
    public String generatorRtmpPushUrl(Number effectivetime, @NotEmpty String streamName);

    /**
     * 生成rtmp拉流地址
     * @param liveMinute
     * @param streamName
     * @return
     */
    public String generatorRtmpPullUrl(@NotEmpty String streamName);


    /**
     * 断开频道
     * @param streamName
     * @return
     */
    public boolean dropLiveStream(@NotEmpty String streamName);
}
